import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class SubmissionService {
  constructor(private http: HttpClient) {}

  submitSolution(problemId: number, code: string, language: string): Observable<any> {
    return this.http.post('/api/submissions', {
      problemId,
      code,
      language
    });
  }
}
